<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Agp\CoreBundle\Entity;

use Sylius\Bundle\CartBundle\Entity\Cart as BaseCart;
use Sylius\Bundle\CartBundle\Model\CartInterface;
use Doctrine\Common\Collections\Collection;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Agp\CoreBundle\Entity\FormaPagamento;
use Symfony\Component\Validator\Constraints as Assert;
use Agp\CoreBundle\Entity\ListaPreco;
use Agp\CoreBundle\Entity\Pedido;

use Doctrine\ORM\Mapping as ORM;

/**
 * Description of Pedido
 *
 * @author bondcs
 * @ORM\Table(name="pedido_terminal")
 * @ORM\Entity(repositoryClass="Agp\CoreBundle\Repository\PedidoRepository")
 * @ORM\HasLifecycleCallbacks
 * 
 */
class PedidoTerminal{
    
    /**
     * @var integer $id
     *
     * @ORM\Column(name="cod_pedido_terminal", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     * @GRID\Column(title="Código", type="text", size="5", primary=true, visible=false, align="center")
     */
    protected $codPedidoTerminal;
    
    /**
     * 
     * @ORM\Column(name="cod_venda_terminal", type="integer", nullable=true)
     */
    protected $codVendaTerminal;
    
    /**
     * 
     * @ORM\ManyToOne(targetEntity="Agp\CoreBundle\Entity\Empresa", fetch="LAZY")
     * @ORM\JoinColumn(name="cod_empresa", referencedColumnName="cod_empresa")
     */
    protected $empresa;
    
    /**
     * 
     * @ORM\ManyToOne(targetEntity="Agp\CoreBundle\Entity\Terminal", fetch="LAZY")
     * @ORM\JoinColumn(name="cod_terminal", referencedColumnName="cod_terminal")
     */
    protected $terminal;
    
    /**
     * 
     * @ORM\ManyToOne(targetEntity="Agp\CoreBundle\Entity\Evento", fetch="LAZY")
     * @ORM\JoinColumn(name="cod_evento", referencedColumnName="cod_evento", nullable=true)
     */
    protected $evento;
    
    /**
     * 
     * @ORM\ManyToOne(targetEntity="Agp\CoreBundle\Entity\Pedido", cascade={"all"}, fetch="LAZY")
     * @ORM\JoinColumn(name="cod_pedido", referencedColumnName="cod_pedido", nullable=true, onDelete="Cascade")
     */
    protected $pedido;
    
    /**
     * @ORM\Column(name="valor", type="float", nullable=true)
     */
    protected $valor;
    
    public function __construct() {
        $this->dtPedido = new \DateTime;
    }

    public function getCodPedidoTerminal() {
        return $this->codPedidoTerminal;
    }

    public function setCodPedidoTerminal($codPedidoTerminal) {
        $this->codPedidoTerminal = $codPedidoTerminal;
    }

    public function getCodVendaTerminal() {
        return $this->codVendaTerminal;
    }

    public function setCodVendaTerminal($codVendaTerminal) {
        $this->codVendaTerminal = $codVendaTerminal;
    }

    public function getEmpresa() {
        return $this->empresa;
    }

    public function setEmpresa($empresa) {
        $this->empresa = $empresa;
    }

    public function getTerminal() {
        return $this->terminal;
    }

    public function setTerminal($terminal) {
        $this->terminal = $terminal;
    }

    public function getEvento() {
        return $this->evento;
    }

    public function setEvento($evento) {
        $this->evento = $evento;
    }

    public function getPedido() {
        return $this->pedido;
    }

    public function setPedido($pedido) {
        $this->pedido = $pedido;
    }

    public function getValor() {
        return $this->valor;
    }

    public function setValor($valor) {
        $this->valor = $valor;
    }

}

?>